import { createStore } from 'vuex'
import mutations from './mutations.js'
// 把mutations统一封装到mutations的文件中，进行统一管理
// 做项目的原则，简单入手
// 做数据持久化
import storage from '../utils/storage.js'
const state = {
    // 用户信息
    userInfo: storage.getItem('userInfo') || {},
    menuList: storage.getItem('menuList') || [],
    actionList: storage.getItem('actionList') || [],
}

export default createStore({
    state,
    mutations,
})